package com.cspm.ahjy.bc.office.word.domain;

/**
 * 段落中的字体，对应XML中的<w:r>标签
 * 
 * @author ServerZhang
 * @date 2017年9月27日
 */
public class MSFont {

	private String text = "";// 文字内容
	private String fontName = "默认字体";// 字体
	private Integer fontSize = 0;// 字号
	private String color = "000000";// 颜色，默认黑色
	private Boolean bold = false;// 加粗
	private Boolean italic = false;// 斜体
	private String underline = "";// 下划线样式
	private String underlineColor = "000000";// 下划线颜色，默认黑色
	private Boolean strike = false;// 删除线
	private Boolean dbStrike = false;// 双删除线
	private String stress = "";// 着重号样式

	private Integer paragraphNum;// 所在真实段落

	private Integer type = 0;// 类型：0普通文字，1艺术字，2图片
	private MSWordart msWordart = null;// 艺术字
	private MSPicture msPicture = null;// 图片

	public MSFont() {

	}

	public MSFont(String fontName, Integer fontSize, String color,
			Boolean bold, Boolean italic, String underline, Boolean strike,
			Boolean dbStrike) {
		this.fontName = fontName;
		this.fontSize = fontSize;
		this.color = color;
		this.bold = bold;
		this.italic = italic;
		this.underline = underline;
		this.strike = strike;
		this.dbStrike = dbStrike;
	}

	public MSFont(String fontName, Integer fontSize, String color,
			Boolean bold, Boolean italic, String underline, Boolean strike,
			Boolean dbStrike, Integer paragraphNum) {
		this.fontName = fontName;
		this.fontSize = fontSize;
		this.color = color;
		this.bold = bold;
		this.italic = italic;
		this.underline = underline;
		this.dbStrike = dbStrike;
		this.dbStrike = dbStrike;
		this.paragraphNum = paragraphNum;
	}
	
	/**
	 * 判断是否是相同内容
	 * @param font
	 * @return
	 * @author ServerZhang
	 * @date 2017年10月12日
	 */
	public Boolean maybeEquals(MSFont font){
		if (font == null) {
			return Boolean.FALSE;
		}
		MSPicture msPicture2 = font.getMsPicture();
		MSWordart msWordart2 = font.getMsWordart();
		if (msPicture2 != null) {
			if (msPicture2.maybeEquals(this.msPicture)) {
				return Boolean.TRUE;
			}
			
		}else if (msWordart2 != null) {
			if (msWordart2.maybeEquals(this.msWordart)) {
				return Boolean.TRUE;
			}
		}else {
			if (this.text.equals(font.getText())) {
				return Boolean.TRUE;
			}
		}
		return Boolean.FALSE;
	}

	public String getFontName() {
		return fontName;
	}

	public void setFontName(String fontName) {
		this.fontName = fontName;
	}

	public Integer getFontSize() {
		return fontSize;
	}

	public void setFontSize(Integer fontSize) {
		this.fontSize = fontSize;
	}

	public String getColor() {
		return color;
	}

	public void setColor(String color) {
		this.color = color;
	}

	public Boolean getBold() {
		return bold;
	}

	public void setBold(Boolean bold) {
		this.bold = bold;
	}

	public Boolean getItalic() {
		return italic;
	}

	public void setItalic(Boolean italic) {
		this.italic = italic;
	}

	public String getUnderline() {
		return underline;
	}

	public void setUnderline(String underline) {
		this.underline = underline;
	}

	public Boolean getStrike() {
		return strike;
	}

	public void setStrike(Boolean strike) {
		this.strike = strike;
	}

	public Boolean getDbStrike() {
		return dbStrike;
	}

	public void setDbStrike(Boolean dbStrike) {
		this.dbStrike = dbStrike;
	}

	public Integer getParagraphNum() {
		return paragraphNum;
	}

	public void setParagraphNum(Integer paragraphNum) {
		this.paragraphNum = paragraphNum;
	}

	public String getText() {
		return text;
	}

	public void setText(String text) {
		this.text = text;
	}

	public MSWordart getMsWordart() {
		return msWordart;
	}

	public void setMsWordart(MSWordart msWordart) {
		this.msWordart = msWordart;
	}

	public String getUnderlineColor() {
		return underlineColor;
	}

	public void setUnderlineColor(String underlineColor) {
		this.underlineColor = underlineColor;
	}

	public String getStress() {
		return stress;
	}

	public void setStress(String stress) {
		this.stress = stress;
	}

	public Integer getType() {
		return type;
	}

	public void setType(Integer type) {
		this.type = type;
	}

	public MSPicture getMsPicture() {
		return msPicture;
	}

	public void setMsPicture(MSPicture msPicture) {
		this.msPicture = msPicture;
	}
	
	

}
